TryGetValue Method

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Determines if this dictionary contains a key equal to key. If so, the value associated with that key is returned through the value parameter.

Namespace: Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax

C#
public override sealed bool TryGetValue(
	TKey key,
	out TValue value
)
Visual Basic (Declaration)
Public Overrides NotOverridable Function TryGetValue ( _
	key As TKey, _
	<OutAttribute> ByRef value As TValue _
) As Boolean
Visual C++
public:
virtual bool TryGetValue (
	TKey key, 
	[OutAttribute] TValue% value
) override sealed

Parameters

key
TKey
The key to search for.
value
TValue%
Returns the value associated with key, if true was returned.

Return Value

True if the dictionary contains key. False if the dictionary does not contain key.

Remarks

TryGetValue takes time O(log N), where N is the number of entries in the dictionary.

See Also